<?php
class db_PDO extends DB
{
    public static function getConn()
    {
        Config::load('db');
        $host = Config::get('db.host');
        $username = Config::get('db.username');
        $password = Config::get('db.password');
        $dbname = Config::get('db.dbname');
        try
        {
            $conn = new PDO("mysql:host={$host};dbname={$dbname}", $username, $password);
            $conn->query('SET NAMES utf8');
            return $conn;
        }
        catch (PDOException $e)
        {
            die($e->getMessage());
        }
    }
}
